<h3  class="content_title">{$content_info.title}</h3>
<div class="content_info">
	<table width="100%">
	<tr>
	<td width="18">
{if $prev!=''}
<a href="{$prev.url}" {if $content.target}target="_blank"{/if}><img src="templates/{$config.site_template}/images/prev.gif" alt=""/></a>
{/if}
	</td>
	<td align="center"  height="28">{$language.content_time}{$content_info.time}&nbsp;{$language.content_click_count}{$content_info.click_count}{$language.content_click_count_unit}&nbsp;
	
	<span class="small" id="fontSmall" onclick="change_font(0)">T</span> <span class="big" id="fontBig" onclick="change_font(1)">T</span>

	<img src="templates/{$config.site_template}/images/print.gif" style="cursor:pointer" alt="" align="absmiddle" onclick="window.print()"/>
	</td>
	<td width="18">
	{if $next!=''}
	<a href="{$next.url}" {if $content.target}target="_blank"{/if}><img src="templates/{$config.site_template}/images/next.gif" alt=""/></a>
{/if}
	</td>
	</tr>
	</table>
</div>
<div class="content_description">{$content_info.description}</div>
<div class="content_text" id="content_text">{$content_info.text}</div>

{if $content_info.links}
<table width="98%" cellpadding="5" cellspacing="1" bgcolor="#eeeeee" style="margin:auto">
<tr>
<td width="80" bgcolor="#f4f4f4" height="30" align="center">{$language.content_links}</td>
<td bgcolor="#ffffff">&nbsp;
	{foreach from=$content_info.links item=link}
			&nbsp;<a href="{$link.url}" target="_blank">{$link.url}</a>
	{/foreach}
</td>
</tr>
</table>
{/if}
<div class="clear"></div>
{if $content_info.attachments}
<table width="98%" cellpadding="5" cellspacing="1" bgcolor="#eeeeee" style="margin:auto">
<tr>
<td width="80" bgcolor="#f4f4f4" height="30" align="center">{$language.content_attachment}</td>
<td bgcolor="#ffffff">&nbsp;
	{foreach from=$content_info.attachments item=attachment}
			<a href="uploads/{$attachment.name}" target="_blank">{$attachment.name}</a>
	{/foreach}
</td>
</tr>
</table>
<div class="clear"></div>
{/if}

<table cellspacing="5" cellpadding="0" style="margin:auto">
<tr>
<td>
	<table cellspacing="0" cellpadding="0">
	<tr><td bgcolor="#2A5388" align="center" style="font:bold 1em Arial;color:#fff;width:50px;height:30px;" id="support">{$content_info.support}</td><td bgcolor="#ffffff" align="center"  style="border:1px solid #eee;border-left:none;width:50px;cursor:pointer" onclick="support({$content_info.id})">{$language.content_support}</td></tr>
	</table>
	</td>
	<td>
	<table cellspacing="0" cellpadding="0">
	<tr><td bgcolor="#2A5388" align="center" style="font:bold 1em Arial;color:#fff;width:50px;height:30px;" id="against">{$content_info.against}</td><td bgcolor="#ffffff" align="center" style="border:1px solid #eee;border-left:none;width:50px;cursor:pointer" onclick="against({$content_info.id})">{$language.content_against}</td></tr>
	</table>
</td></tr>
	</table>

<script type="text/javascript">
$(function(){
	$.ajax({
		url:'content.php?action=ajax.support&mode=read&id={$content_info.id}',
		type:'GET',
		success:function(e){
			if (e!='ERROR'){
				$('#support').html(e);
			}
		}
	});
	$.ajax({
		url:'content.php?action=ajax.against&mode=read&id={$content_info.id}',
		type:'GET',
		success:function(e){
			if (e!='ERROR'){
				$('#against').html(e);
			}
		}
	});
});
function copy() {
    if (window.clipboardData) {
        window.clipboardData.setData("Text",arguments[0]);
		 alert('{$language.content_copy_link_success}');
    }else{
		 alert('{$language.content_copy_link_failed}');
    }
}
function change_font(type){
		if(type==0){
			$("#content_text").css("font-size","14px");
			$("#content_text > *").css("font-size","14px");
		}else{
			$("#content_text").css("font-size","16px");
			$("#content_text > *").css("font-size","16px");
		}
}
function support(id)
{
	if (!GetCookie('content_'+id))
	{	
		$.ajax({
			url:'content.php?action=ajax.support&id='+id,
			type:'GET',
			success:function(e){
				if (e!='ERROR'){
					$('#support').html(e);
					SetCookie('content_'+id,true,365);
				}
			}
		});
	}else{
		alert('{$language.content_have_participated}');
	}
}
function against(id)
{
	if (!GetCookie('content_'+id))
	{	
		$.ajax({
			url:'content.php?action=ajax.against&id='+id,
			type:'GET',
			success:function(e){
				if (e!='ERROR'){	
					$('#against').html(e);
					SetCookie('content_'+id,true,365);
				}
			}
		});
	}else{
		alert('{$language.content_have_participated}');
	}
}
function GetCookie(){
		var m='';
		if(window.RegExp)
		{
			var re=new RegExp(';\\s*'+arguments[0]+'=([^;]*)','i');
			m=re.exec(';'+document.cookie);
		}
		return(m?unescape(m[1]):'');
}	
function SetCookie(){
	var $Date=new Date();
	var $Expires=($Date.setTime($Date.getTime()+(arguments[2]*86400000)));
	var $Time=$Date.toGMTString();
	var exp=';expires='+ $Time;
	document.cookie=arguments[0]+'='+escape(arguments[1])+exp+';path=/';
}
</script>